{extend name='admin@main'}

{block name="button"}

{if auth("add")}
<!-- <button data-modal='{:url("sync")}' data-title="同步数据" class='layui-btn layui-btn-sm layui-btn-primary'>同步数据</button> -->
<!-- <button data-modal='{:url("add")}' data-title="添加企业" class='layui-btn layui-btn-sm layui-btn-primary'>添加企业</button> -->
{/if}

{if auth("remove")}
<button data-action='{:url("remove_review")}' data-rule="id#{key}" data-csrf="{:systoken('remove_review')}" data-confirm="确定要删除这些企业吗？" action="{:url('company/remove_review')}" class='layui-btn layui-btn-sm layui-btn-primary'>删除申请记录</button>
{/if}
{if auth("sendwx")}
<!-- <button data-modal='{:url("property/Company/sendwx")}?type=sendall'  data-csrf="{:systoken('property/Company/sendwx')}" data-rule="id={key}&type=sendall&modaltype=choiceall" data-title="发送消息" class='layui-btn layui-btn-sm layui-btn-primary sendwx'>发送通知消息</button> -->
{/if}
{/block}

{block name="content"}
{php}
{//var_dump($list);}
{/php}

<div class="think-box-shadow">
    {include file='company/index_search_review'}
    <table class="layui-table" lay-skin="line">
        {notempty name='list'}
        <thead>
        <tr>
            <th class='list-table-check-td think-checkbox'>
                <label><input data-auto-none data-check-target='.list-check-box' type='checkbox'></label>
            </th>
            <th class='list-table-sort-td'>
                <button type="button" data-reload class="layui-btn layui-btn-xs">刷 新</button>
            </th>
            <th class='text-left nowrap'>申请人</th>
            <th class='text-left nowrap'>申请人-联系</th>
            {if $userinfo['db1']['authorize'] == 1}
            <th class='text-left nowrap'>公司名称</th>
            {/if}
            <th class='text-left nowrap'>申请部门</th>
            {if $userinfo['db1']['authorize'] == 1}
            <th class='text-left nowrap'>公司地址</th>

            {if $userinfo['db1']['authorize']==1}
            <th class='text-center nowrap'>公司类型</th>
            {/if}
            {/if}
            <th class='text-center nowrap'>审核状态</th>
            <th class='text-left nowrap'>添加时间</th>
            <th class='text-left nowrap'>操作选项</th>
        </tr>
        </thead>
        {/notempty}
        <tbody>
        {foreach $list as $key=>$vo}
        <tr data-dbclick>
            <td class='list-table-check-td think-checkbox'>
                <label><input class="list-check-box" value='{$vo.id}' type='checkbox'></label>
            </td>
            <!--<td class='list-table-sort-td'>-->
            <!--    <label><input data-action-blur="{:request()->url()}" data-value="id#{$vo.id};action#sort;sort#{value}" data-loading="false" value="{$vo.id}" class="list-sort-input"></label>-->
            <!--</td>-->
              <td class='list-table-sort-td'>
                <label>{$vo.id}</label>
            </td>
            <td class='text-left nowrap'>{$vo.user_name|default=''}</td>
            <td class='text-left nowrap'>{$vo.user_mobile|default=''}</td>
            {if $userinfo['db1']['authorize']==1}
            <td class='text-left nowrap'>{$vo.company_name|default=''}</td>
            {/if}
            <td class='text-left nowrap'>{$vo.dept_name}</td>
            {if $userinfo['db1']['authorize']==1}
            <td class='text-left nowrap'>{$vo.company_address|default='-'}</td>

            {if $userinfo['db1']['authorize']==0 || $userinfo['db1']['authorize']==1}
                {switch name="vo.apply_status" }
                    {case value='0'}<td class='text-left nowrap'>普通公司(商户)</td>{/case}
                    {case value='2'}<td class='text-left nowrap'>物业公司</td>{/case}
                    {case value='3'}<td class='text-left nowrap'>普通公司(无物业)</td>{/case}
                    {default/}-未知-
                {/switch}
                   {/if}

                   {/if}

            <td class='text-center nowrap'>
               
 {switch name="vo.apply_status" }
    {case value='0'}<a href="javascript:;" title="待审核状态"><i class="layui-icon" style="font-size: 32px;color:#FFB800 ">&#xe65f;</i></a>{/case}
    {case value='1'}<a href="javascript:;" title="已审核通过"><i class="layui-icon" style="font-size: 32px;color:#009688 ">&#xe65f;</i></a>{/case}
    {case value='2'}<a href="javascript:;" title="已拒绝加入"><i class="layui-icon" style="font-size: 32px;color:#FF5722 ">&#xe65f;</i></a>{/case}  
    {default  /}-
 {/switch}
            </td>


          
            <td class='text-left nowrap'>
                {$vo.apply_createtime|format_datetime}
            </td>
            <td class='text-left nowrap'>
                {if auth("sendwx")}
                        
                {/if}

                {if auth("edit")}
                <!-- <a data-dbclick class="layui-btn layui-btn-sm" data-title="编辑公司信息" data-modal='{:url("edit")}?id={$vo.id}'>编 辑</a> -->
                {/if}

<!-- <br>
<div class="margin-top-10"></div> -->
                {if auth("state_review") and $vo.apply_status == 0}
                <a class="layui-btn layui-btn-sm layui-btn-normal" data-action="{:url('state_review')}" data-value="id#{$vo.id};status#1" data-csrf="{:systoken('state')}">同意加入</a>
                 <a class="layui-btn layui-btn-sm layui-btn-danger" data-action="{:url('state_review')}" data-value="id#{$vo.id};status#2" data-csrf="{:systoken('state')}">拒绝加入</a>
                {elseif auth("state_review") and $vo.apply_status neq 1|0 }

                {/if}

                {if auth("details_review")}
                   <!--  <button data-modal='{:url("details_review")}?id={$vo.id}&user_id={$vo.apply_uid}' data-title="申请人资料" class='layui-btn layui-btn-sm layui-btn-primary'>申请人资料详情</button> -->
                {/if}

               
 {switch name="vo.apply_status" }
    {case value='1'}<button type="button" class="layui-btn layui-btn-sm layui-btn-radius">已同意加入</button>{/case}
    {case value='2'}<button type="button" class="layui-btn layui-btn-sm layui-btn-radius layui-btn-danger">已拒绝加入</button>{/case}  
    {/default}-
 {/switch}
<!--                 {if auth("remove")}
                <a class="layui-btn layui-btn-sm layui-btn-danger" data-confirm="确定要删除该企业吗？" data-action="{:url('remove')}" data-value="id#{$vo.id}" data-csrf="{:systoken('remove')}" action="{:url('company/remove')}">删 除</a>
                {/if} -->


            </td>
        </tr>
        {/foreach}
        </tbody>
    </table>

    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}

</div>

{/block}


